/* 交易弹窗样式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: #1f2937;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #374151;
}

.modal-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  color: white;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: #f9fafb;
  margin: 0;
}

.modal-subtitle {
  font-size: 14px;
  color: #9ca3af;
  margin: 4px 0 0 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #374151;
  color: #f9fafb;
}

.modal-body {
  padding: 24px;
}

.trading-section, .order-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.section-icon {
  font-size: 20px;
}

.section-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #f9fafb;
  margin: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #d1d5db;
}

.label-icon {
  font-size: 16px;
}

.form-select, .form-input {
  background: #374151;
  border: 1px solid #4b5563;
  border-radius: 8px;
  padding: 12px 16px;
  color: #f9fafb;
  font-size: 14px;
  transition: all 0.2s ease;
}

.form-select:focus, .form-input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-select option {
  background: #374151;
  color: #f9fafb;
}

.quantity-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quantity-btn {
  background: #374151;
  border: 1px solid #4b5563;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f9fafb;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quantity-btn:hover {
  background: #4b5563;
  border-color: #6b7280;
}

.quantity-input .form-input {
  flex: 1;
  text-align: center;
}

.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #d1d5db;
  cursor: pointer;
}

.toggle-input {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: #4b5563;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #f9fafb;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.toggle-input:checked + .toggle-slider {
  background: #10b981;
}

.toggle-input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: #4b5563;
  border-radius: 50%;
  color: #9ca3af;
  font-size: 12px;
  cursor: help;
  margin-left: 4px;
}

.amount-display {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #374151;
}

.btn-primary, .btn-secondary, .btn-danger {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: #10b981;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #059669;
}

.btn-primary:disabled {
  background: #4b5563;
  color: #9ca3af;
  cursor: not-allowed;
}

.btn-secondary {
  background: #374151;
  color: #d1d5db;
  border: 1px solid #4b5563;
}

.btn-secondary:hover {
  background: #4b5563;
  border-color: #6b7280;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-icon {
  font-size: 16px;
}

.trading-info {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
}

.trading-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.info-item {
  padding: 8px 0;
  border-bottom: 1px solid #374151;
  font-size: 14px;
}

.info-item:last-child {
  border-bottom: none;
}

.info-item strong {
  color: #d1d5db;
  margin-right: 8px;
}

/* 多选账户样式 */
.multiselect-container {
  position: relative;
  width: 100%;
}

.multiselect-input {
  background: #374151;
  border: 1px solid #4b5563;
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.multiselect-input:hover {
  border-color: #6b7280;
}

.multiselect-input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.multiselect-placeholder {
  color: #9ca3af;
  font-size: 14px;
}

.multiselect-arrow {
  color: #9ca3af;
  font-size: 12px;
  transition: transform 0.2s ease;
}

.multiselect-arrow.open {
  transform: rotate(180deg);
}

.multiselect-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #374151;
  border: 1px solid #4b5563;
  border-radius: 8px;
  margin-top: 4px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
}

.multiselect-options {
  padding: 8px 0;
}

.multiselect-option {
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s ease;
}

.multiselect-option:hover {
  background: #4b5563;
}

.multiselect-option input[type="checkbox"] {
  margin: 0;
  accent-color: #10b981;
}

.multiselect-option label {
  cursor: pointer;
  font-size: 14px;
  color: #f9fafb;
  margin: 0;
  flex: 1;
}

.multiselect-actions {
  padding: 8px 16px;
  border-top: 1px solid #4b5563;
  display: flex;
  gap: 8px;
}

.multiselect-btn {
  background: #4b5563;
  border: 1px solid #6b7280;
  border-radius: 4px;
  padding: 4px 8px;
  color: #f9fafb;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.multiselect-btn:hover {
  background: #6b7280;
  border-color: #9ca3af;
}

.selected-accounts {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.selected-account-tag {
  background: #10b981;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.selected-account-tag .remove-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.selected-account-tag .remove-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 响应式设计 */
@media (max-width: 640px) {
  .modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .modal-header {
    padding: 16px 20px;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .btn-primary, .btn-secondary, .btn-danger {
    width: 100%;
    justify-content: center;
  }
}

/* 管理员广播分组样式 */
.broadcast-group-item.admin {
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  background: #ffffff;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.broadcast-group-item.admin:hover {
  border-color: #3b82f6;
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}

.group-type {
  font-size: 20px;
  margin-right: 8px;
}

.group-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 12px;
}

.group-created {
  display: flex;
  align-items: center;
}

.group-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.group-actions .btn {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.group-actions .btn.primary {
  background: #3b82f6;
  color: white;
  border: none;
}

.group-actions .btn.primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.group-actions .btn.secondary {
  background: #6b7280;
  color: white;
  border: none;
}

.group-actions .btn.secondary:hover {
  background: #4b5563;
  transform: translateY(-1px);
}

.group-actions .btn.danger {
  background: #ef4444;
  color: white;
  border: none;
}

.group-actions .btn.danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

/* 分组成员样式 */
.member-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #f9fafb;
  transition: all 0.2s ease;
}

.member-item:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.member-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.member-name {
  font-weight: 600;
  color: #1f2937;
  font-size: 14px;
}

.member-role {
  font-size: 12px;
  color: #6b7280;
  background: #e5e7eb;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
}

.member-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.member-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
}

.member-status.success {
  background: #d1fae5;
  color: #065f46;
}

.member-status.warning {
  background: #fef3c7;
  color: #92400e;
}

.member-joined {
  font-size: 11px;
  color: #6b7280;
}

.member-actions {
  display: flex;
  gap: 8px;
}

.member-actions .btn {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* 风控配置样式 */
.risk-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.config-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

.config-item label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.config-value {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

/* 暗色主题下的管理员广播分组样式 */
@media (prefers-color-scheme: dark) {
  .broadcast-group-item.admin {
    background: #1f2937;
    border-color: #374151;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }
  
  .broadcast-group-item.admin:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
  }
  
  .group-name {
    color: #f9fafb;
  }
  
  .group-description {
    color: #d1d5db;
  }
  
  .group-meta {
    color: #9ca3af;
  }
  
  .member-item {
    background: #374151;
    border-color: #4b5563;
  }
  
  .member-item:hover {
    background: #4b5563;
    border-color: #6b7280;
  }
  
  .member-name {
    color: #f9fafb;
  }
  
  .member-role {
    background: #4b5563;
    color: #d1d5db;
  }
  
  .member-joined {
    color: #9ca3af;
  }
  
  .config-item {
    background: #374151;
    border-color: #4b5563;
  }
  
  .config-item label {
    color: #9ca3af;
  }
  
  .config-value {
    color: #f9fafb;
  }
}

/* 数据源指示器样式 */
.data-source-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 8px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 6px;
  font-size: 12px;
}

.indicator-dot {
  width: 6px;
  height: 6px;
  background: #fbbf24;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.indicator-text {
  color: #92400e;
  font-weight: 500;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* 暗色主题下的数据源指示器 */
@media (prefers-color-scheme: dark) {
  .data-source-indicator {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.4);
  }
  
  .indicator-text {
    color: #fbbf24;
  }
}
